﻿using System;
using Internal.Runtime;
using Runtime.Models;

namespace Runtime {

    /// <summary>
    /// 数据中心
    /// </summary>
    public class DFR_BattleDataCenterTD : DFR_BattleDataCenterBase, IDFR_BattleDataCenterTDInternal, IDisposable {

        /// <summary>
        /// 运行时数据
        /// </summary>
        public new IDFR_BattleModelsTD Models => (IDFR_BattleModelsTD)base.Models;

        void IDFR_BattleDataCenterTDInternal.NewModels() {
            (DFR_BattleBase.DataCenter as IDFR_BattleDataCenterBaseInternal).NewModels();
            m_Models = (IDFR_BattleModelsTD)DFR_BattleBase.DataCenter.Models;
        }

        void IDisposable.Dispose() {
            if (DFR_BattleBase.DataCenter is IDisposable disposable) {
                disposable.Dispose();
            }
            m_Models = null;
        }
    }
}

namespace Internal.Runtime {

    public interface IDFR_BattleDataCenterTDInternal : IDFR_BattleDataCenterBaseInternal {

        new void NewModels();
    }
}
